import apiClient from '@/api/apiClient';

const baseUrl = '/management/position';
const baseUrls = '/management/positions';

const getPositionsList = (data?: any) => apiClient.get({ url: `${baseUrls}`, params: data });

// 新增
const createPosition = (data?: any) => apiClient.post({ url: `${baseUrl}`, data });

// 删除
const deletePosition = (code: string) => apiClient.delete({ url: `${baseUrl}/${code}` });

// 修改
const updatePosition = (code?: string, data?: any) =>
  apiClient.put({ url: `${baseUrl}/${code}`, data });

const userAddPosition = (data?: any) => apiClient.post({ url: `/user-position`, data });

export default {
  getPositionsList,
  createPosition,
  deletePosition,
  updatePosition,
  userAddPosition,
};
